﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QLDBHYT.DAO;
using QLDBHYT.VO;
using QLDBHYT.BUS;

namespace QLDBHYT
{
    public partial class frmKiemtra : Form
    {
        public frmKiemtra()
        {
            InitializeComponent();
        }

        private void btnRefresh_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            PhieuNhapDAO phieunhapDAO = new PhieuNhapDAO();
            DataTable dataTable = phieunhapDAO.kiemtraDAO(dtNgay.Value.Month + "/" + dtNgay.Value.Day + "/" + dtNgay.Value.Year);
            flex.Rows.Count = 1;
            foreach (DataRow dr in dataTable.Rows)
            {
                flex.Rows.Count++;
                flex.Rows[flex.Rows.Count - 1]["sophieu"] = dr["sophieu"];
                flex.Rows[flex.Rows.Count - 1]["ho_ten"] = dr["ho_ten"];
                flex.Rows[flex.Rows.Count - 1]["mathe"] = dr["mathe"];
                flex.Rows[flex.Rows.Count - 1]["ngay_tt"] = dr["ngay_tt"];
                flex.Rows[flex.Rows.Count - 1]["tongtien"] = dr["tongtien"];
                flex.Rows[flex.Rows.Count - 1]["tienct"] = dr["tienct"];
                flex.Rows[flex.Rows.Count - 1]["sosanh"] = dr["sosanh"];
                flex.Rows[flex.Rows.Count - 1]["loai"] = dr["loai"];


            }
            Cursor.Current = Cursors.Default;
        }
    }
}
